import unittest

import ddt

from com.hanamaki.study.db import DbConnect03
from com.hanamaki.study.unittest.paramter.ddt import FileUtils

dp1 = [
    ('hanamaki', '123456'),
    ('andy', '123456'),
    ('jojo', '123456'),
    ('jack', '123456'),
    ('rose', '123456'),
    ('yutou', '123456'),
]

dp2 = [
    {'username': 'hanamaki', 'password': '123456'},
    {'username': 'andy', 'password': '123456'},
    {'username': 'jojo', 'password': '123456'},
    {'username': 'jack', 'password': '123456'},

]

dp3 = DbConnect03.test_sql()

dp4 = FileUtils.read_excel('dataContent.xls')


@ddt.ddt()
class TestClass_My(unittest.TestCase):

    @ddt.data(*dp1)
    def test_tuple(self, data):
        print(data)

    @ddt.data(*dp2)
    def test_dict(self, data):
        print(data)

    @ddt.data(*dp3)
    def test_sql(self, data):
        print(data)

    @ddt.data(*dp4)
    def test_excel(self, data):
        print(data)


if __name__ == '__main__':
    unittest.main()
